<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link href="https://cdn.jsdelivr.net/npm/animate.css@3.5.1" rel="stylesheet" type="text/css">
  <script type="text/javascript" src="../vue.js"></script>
  <style>
    .box {
      width: 200px;
      height: 200px;
      background: green;
    }



  </style>
</head>

<body>
  <div id="app">

    <transition name="box" 
    appear
    enter-active-class="animated tada"
    leave-active-class="animated bounceOutRight"
    >
      <div class="box" v-if="show"></div>
    </transition>

    <button @click="show=!show">显示/隐藏</button>

  </div>

  <script>

    var vm = new Vue({
      data: {
        show: true
      },
      el: "#app"
    })

  </script>
</body>

</html>